import ora from "ora"; //进度条

export async function withOra(fn, text) {
  console.log("123123");
  let loading = ora(text);
  loading.start();
  let data = await fn();
  console.log("data-->", data);
  loading.succeed();
  return data;
}

export const betterRequire = (absPath) => {
  //两种引入方式
  let module = require(absPath);
  if (module.default) {
    return module.default;
  }
  return module;
};
